package cn.lingyangwl.agile.system.model.rqrs.tenant;

import cn.lingyangwl.agile.model.constants.ValidationCons;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

/**
 * @author shenguangyang
 */
@Data
@Accessors(chain = true)
public class TenantBase {
    @ApiModelProperty(value = "绑定域名", example = "test, 实际为 https://test.lingyangwl.cn")
    private String domain;

    @ApiModelProperty(value = "是否为系统内置, 系统内置的不能被删除")
    private Boolean sysBuiltIn;

    @ApiModelProperty(value = "名称")
    @NotEmpty(message = ValidationCons.NOT_EMPTY)
    private String name;

    @ApiModelProperty(value = "图标")
    private String logo;

    @ApiModelProperty(value = "状态 1正常 0冻结")
    @NotEmpty(message = ValidationCons.NOT_EMPTY)
    private String status;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date beginTime;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date endTime;

    /**
     * 如果保存的是子租户则不需要传递, 主租户必须传
     */
    @ApiModelProperty(value = "租户场景")
    private Long sceneId;

    /**
     * 如果保存的是子租户则不需要传递, 主租户必须传
     */
    @ApiModelProperty(value = "租户套餐编号")
    private Long packageId;

    /**
     * 如果保存的是子租户则不需要传递
     * 如果保存的是主租户, 默认值是 {@link #setPackageId(Long)}
     */
    @ApiModelProperty(value = "子租户套餐编号")
    private Long subPackageId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "是否为管理端租户(管理某一个场景)")
    private Boolean isMgtSceneTenant;
}
